{% extends "../base_adminlte.html" %}

{% block content %}
<div class="content-wrapper">
  <!-- Content Header (Page header) -->
    <div class="content-header">
    </div>

  <section class="content">
        <form  action="{% url 'hostsmod' %}?id={{ hosts.id }}" method="post">
            <table style="border-collapse:separate; border-spacing: 0px 10px;
            margin-left: 400px;margin-top: 60px;align-content: center;">
                <tr>
                <td>系统</td>
                  <td>
                        <select id='systemname' name="systemname" class="form-control"  >
                              <option value="{{ hosts.systemname }}" >
                                  {{ hosts.systemname }}</option>
                                     {% for i in system %}
                                     {% if i == hosts.systemname  %}
                                     {% else %}
                                      <option value="{{ i }}">
                                          {{  i }}
                                      </option>
                                     {% endif %}
                        {% endfor %}
                         </select>
                    </td>
                <td>{{ error.systemname.0 }}</td>
            </tr>
                <tr>
                    <td>服务</td>
                    <td><input type="text" name="servicename" value="{{ hosts.servicename }}" >
                    <label>{{ error.servicename.0 }}</label>
                    </td>
                </tr>
                <tr>
                    <td>集群</td>
                    <td><input type="text" name="clustername" value="{{ hosts.clustername }}" >
                    <label>{{ error.clustername.0 }}</label>
                    </td>
                </tr>
                <tr>
                    <td>服务器</td>
                    <td><input type="text" name="hostname" value="{{ hosts.hostname }}" >
                    <label>{{ error.hostname.0 }}</label>
                    </td>
                </tr>
                <tr>
                    <td>位置</td>
                    <td><input type="text" name="Location" value="{{ hosts.location }}" >
                    <label>{{ error.Location.0 }}</label>
                    </td>
                </tr>
                <tr>
                    <td>IP</td>
                    <td><input type="text" name="ip" value="{{ hosts.ip }}" >
                    <label>{{ error.ip.0 }}</label>
                    </td>
                </tr>
                <tr>
                    <td>类型</td>
                    <td><input type="text" name="type" value="{{ hosts.type }}" >
                    <label>{{ error.type.0 }}</label>
                    </td>
                </tr>
                <tr>
                    <td>ansible组</td>
                    <td><input type="text" name="groups" value="{{ hosts.groups }}" >
                    <label>{{ error.groups.0 }}</label>
                    </td>
                </tr>
                <tr>
                    <td>4A</td>
                    <td>
                       <select id='in4A' name="in4A"  class="form-control"  >
                             {% if hosts.in4A == True %}
                             <option value="True" selected >是</option>
                             <option value="False">否</option>
                             {% else %}
                             <option value="True" >是</option>
                             <option value="False" selected>否</option>
                             {% endif %}
                        </select>
                    <label>{{ error.in4A.0 }}</label>
                    </td>
                </tr>
                <tr>
                    <td>管理</td>
                    <td>
                       <select id='manage' name="manage"  class="form-control"  >
                             {% if hosts.manage == True %}
                             <option value="True" selected >是</option>
                             <option value="False">否</option>
                             {% else %}
                             <option value="True" >是</option>
                             <option value="False" selected>否</option>
                             {% endif %}
                        </select>
                    <label>{{ error.manage.0 }}</label>
                    </td>
                </tr>
                <tr>
                    <td>产品</td>
                    <td><input type="text" name="product" value="{{ hosts.product }}" >
                    <label>{{ error.product.0 }}</label>
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td><input type="submit" value="提交" >
                    <button style="margin-left: 10%" onclick="location.href='/ansible/hostslist'" type="button" value="取消" >取消</button></td>
              </tr>
            </table>
    </form>
  </section>
</div>

{% endblock %}
